﻿namespace = dvg_danubian_unification

dvg_danubian_unification.10 = {
	type = country_event
	placement = ROOT

	title = dvg_danubian_unification.10.t
	desc = dvg_danubian_unification.10.d
	flavor = dvg_danubian_unification.10.f

	event_image = {
		video = "gfx/event_pictures/unspecific_military_parade.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/unspecific/military_parade"

	icon = "gfx/interface/icons/event_icons/event_portrait.dds"

	duration = 3

	trigger = {
		year >= 1849
		is_at_war = no
		exists = c:BAV
		this = c:BAV
		exists = c:AUS
		NOT = { has_variable = danubian_brothers }
	}

	immediate = {
		set_variable = danubian_brothers
		c:BOH = {
			remove_diplomatic_pact = {
		    	country = c:AUS
		    	type = alliance
		    }
			remove_diplomatic_pact = {
		    	country = c:BAV
		    	type = alliance
		    }
			remove_diplomatic_pact = {
		    	country = c:AUS
		    	type = defensive_pact
		    }
			remove_diplomatic_pact = {
		    	country = c:BAV
		    	type = defensive_pact
		    }
			change_relations = { 
				country = c:AUS
				value = -100
			}
			change_relations = { 
				country = c:BAV
				value = -100
			}
		}
	}

	option = {
		name = dvg_danubian_unification.10.a
		default_option = yes

		c:BOH = {
			remove_diplomatic_pact = {
		    	country = c:AUS
		    	type = alliance
		    }
			remove_diplomatic_pact = {
		    	country = c:BAV
		    	type = alliance
		    }
			remove_diplomatic_pact = {
		    	country = c:AUS
		    	type = defensive_pact
		    }
			remove_diplomatic_pact = {
		    	country = c:BAV
		    	type = defensive_pact
		    }
			change_relations = { 
				country = c:AUS
				value = -100
			}
			change_relations = { 
				country = c:BAV
				value = -100
			}
		}

		create_diplomatic_play = {
			target_country = c:AUS
			war = no
			type = dp_annex_war

			add_war_goal = {
				holder = c:AUS
				type = annex_country
				target_country = c:BAV
			}
		}

		ai_chance = {
			base = 1
		}
	}
}

# Annex a Swiss country
dvg_danubian_unification.100 = {
	type = country_event
	placement = ROOT

	title = dvg_danubian_unification.100.t
	desc = dvg_danubian_unification.100.d
	flavor = dvg_danubian_unification.100.f

	event_image = {
		video = "gfx/event_pictures/unspecific_signed_contract.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/unspecific/signed_contract"

	icon = "gfx/interface/icons/event_icons/event_portrait.dds"

	duration = 3

	cooldown = { months = 4 }

	trigger = {
		root.infamy < infamy_threshold:infamous
		any_country = {
			OR = {
				AND = {
					exists = c:FIO
					this = c:FIO
				}
				AND = {
					exists = c:BAE
					this = c:BAE
				}
				AND = {
					exists = c:GRB
					this = c:GRB
				}
			}
			OR = {
				is_subject = no
				is_subject_of = ROOT
			}
			country_rank < rank_value:major_power
			relations:root >= relations_threshold:amicable
			is_player = no
			NOT = { has_variable = german_minor_dont_annex }
		}
	}

	immediate = {
		random_country = {
			limit = {
				OR = {
					AND = {
						exists = c:FIO
						this = c:FIO
					}
					AND = {
						exists = c:BAE
						this = c:BAE
					}
					AND = {
						exists = c:GRB
						this = c:GRB
					}
				}
				OR = {
					is_subject = no
					is_subject_of = ROOT
				}
				country_rank < rank_value:major_power
				relations:root >= relations_threshold:amicable
				is_player = no
				NOT = { has_variable = german_minor_dont_annex }
			}
			save_scope_as = german_annex_country
		}
	}

	option = {
		name = dvg_danubian_unification.100.a
		default_option = yes
		annex = scope:german_annex_country
		ai_chance = {
			base = 1
		}
	}
	option = {
		name = dvg_danubian_unification.100.b
		change_relations = {
			country = scope:german_annex_country
			value = 20
		}
		scope:german_annex_country = {
			set_variable = {
				name = german_minor_dont_annex
				days = 1825
			}
		}
		ai_chance = {
			base = 0
		}
	}
}